<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>登录界面</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" type="text/css" th:href="@{/layui/css/layui.css}">
    <script type="text/javascript" th:src="@{/layui/layui.js}"></script>
    <!--semantic-ui-->
    <link th:href="@{/css/semantic.min.css}" rel="stylesheet"></link>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
    <style>
        body{
            background-image: url("/images/stulogin.jpg");
            height: 100%;
            width: 100%;
            background-size: cover;
            position: absolute;
            overflow: hidden;
        }
    </style>
</head>
<body>

<!--菜单-->
<ul class="layui-nav layui-bg-blue" lay-filter="">
    <li class="layui-nav-item"><a th:href="@{/community/index}" style="font-size: 20px">主页面</a></li>
    <li class="layui-nav-item layui-this"><a href="" style="font-size: 20px">登录</a></li>
    <li class="layui-nav-item"><a th:href="@{/register}" style="font-size: 20px">注册</a></li>
<!--    <li class="layui-nav-item"><a th:href="@{/teacherregister}" style="font-size: 20px">教师注册</a></li>-->
</ul>
<!--菜单-->
<br><br><br>

<ul class="layui-fixbar">
    <li class="layui-icon layui-icon-username" id="gotoadmin"></li>
</ul>

<!--登录界面-->
<div class="ui  container">
    <div class="ui segment">

        <h1 class="ui blue dividing header">登录&nbsp;&nbsp;&nbsp;&nbsp;[[${msg}]]</h1>

<form class="layui-form" method="post" th:action="@{/loginsubmit}">
    <div class="layui-form-item">
        <label class="layui-form-label">用户名</label>
        <div class="layui-input-inline">
            <input type="text" name="username" required  lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">密码</label>
        <div class="layui-input-inline">
            <input type="password" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">身份</label>
        <div class="layui-input-block">
            <input type="radio" name="role" value="stu" title="用户" checked>
<!--            <input type="radio" name="role" value="tea" title="教师" >-->
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="submit" class="layui-btn" lay-submit lay-filter="formDemo">登录</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>

</form>
    </div>
</div>
<!--登录界面-->

<script>
    //Demo
    layui.use('form', function(){
        var form = layui.form;

        //监听提交
        // form.on('submit(formDemo)', function(data){
        //     layer.msg(JSON.stringify(data.field));
        //     return false;
        // });
    });
    $(document).ready(function () {
        $('#gotoadmin').click(function () {
            location.href = '/admin_login';
        });
    })
</script>
</body>
</html>